package com.example.demo.controller;

import com.alibaba.fastjson.JSON;
import com.example.demo.pojo.Student;
import com.example.demo.pojo.Teacher;


import com.example.demo.service.oldTeacherSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;




@RestController
@RequestMapping("/content")
public class StudentController {

    @Autowired
    private oldTeacherSerivce oldTeacherSerivce;


    //以下方法测试最基本的访问调通
   /* @RequestMapping(value = "/testJSON")
    public Teacher TestJSON(HttpServletRequest request, @RequestBody Student student) throws InterruptedException {
        TimeUnit.SECONDS.sleep(20);
        Cookie[] cookies = request.getCookies();
        System.out.println(cookies);
        System.out.println("update from branch two");
        System.out.println("21:31新增");
        System.out.println("这是最新108的远程仓库108");
        System.out.println("访问到了2014");
        System.out.println(student);
        return new Teacher("SOH","23");
    }*/

    @RequestMapping(value = "/testString",method =RequestMethod.POST)
    public void TestAppCA( ) throws InterruptedException {
        org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StudentController.class);
        logger.info("logs");
        System.out.println("here");

    }



}
